package com;

import org.apache.ibatis.session.SqlSession;

public class TestUpdate {
    public static void main(String[] args) {
        MyBatisSqlSessionFactory factory = new MyBatisSqlSessionFactory();
        SqlSession sqlSession = factory.getMyBatisSqlSessionFactory().openSession();
        TestDao testDao = sqlSession.getMapper(TestDao.class);
        System.out.println(testDao);

        Car car = new Car();
        car.setId(1);
        car.setName("保时捷");
        testDao.getUpdateCar(car);
        //一定要提交
        sqlSession.commit();
        System.out.println(car.getName());
        System.out.println(car.getPrivce());
    }
}
